
import axios from '../http/axios.js';

export default {
    //---------------------------------------获取学生列表-----------------------------------------
    getStudents(data){
        // console.log(data.pageSize)
        return axios({
            url:'/students/getStudents',
            method:'GET',
            params:{
                type:data.type,
                value:data.value,
                pageSize:data.pageSize,
                currentPage:data.currentPage
            }
            
        })
    },
    //---------------------------------------获取一个学生信息----------------------------------------
    getStudentsById(_id){
        return axios({
            url:'/students/getStudentsById',
            method:'GET',
            params:{
                _id
            }
        })
    },
    //---------------------------------------删除一个学生信息----------------------------------------
    deleteStudents(_id){
        return axios({
            url:'/students/deleteStudents',
            method:'DELETE',
            data:{
                _id
            }
        })
    },
    //---------------------------------------修改学生信息--------------------------------------------
    updateStudents(data){
        console.log(data)
        return axios({
            url:'/students/updateStudents',
            method:'PUT',
            data:{
                ...data
            }
        })
    },
    //---------------------------------------新增学生信息---------------------------------------------
    addStudents(data){
        return axios({
            url:'/students/addStudents',
            method:'POST',
            data
        })
    }
}











